from django.shortcuts import render
from orders.services import RestaurantService

def home(request):
    restaurants = RestaurantService.get_all_restaurants()
    return render(request, 'orders/home.html', {'restaurants': restaurants})

def restaurant_detail(request, restaurant_id):
    restaurant, menu_items = RestaurantService.get_restaurant_with_menu(restaurant_id)
    return render(request, 'orders/restaurant_detail.html', {
        'restaurant': restaurant,
        'menu_items': menu_items
    })